Optimal. Leaf size=83 \[ \frac {b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} d (a-b)^2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d (a-b)}+\frac {x (a-3 b)}{2 (a-b)^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3675, 414, 522, 203, 205} \[ \frac {b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} d (a-b)^2}+\frac {\sin (c+d x) \cos (c+d x)}{2 d (a-b)}+\frac {x (a-3 b)}{2 (a-b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 203
Rule 205
Rule 414
Rule 522
Rule 3675
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x)}{a+b \tan ^2(c+d x)} \, dx &=\frac {\operatorname {Subst}\left (\int \frac {1}{\left (1+x^2\right )^2 \left (a+b x^2\right )} \, dx,x,\tan (c+d x)\right )}{d}\\ &=\frac {\cos (c+d x) \sin (c+d x)}{2 (a-b) d}-\frac {\operatorname {Subst}\left (\int \frac {-a+2 b-b x^2}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (c+d x)\right )}{2 (a-b) d}\\ &=\frac {\cos (c+d x) \sin (c+d x)}{2 (a-b) d}+\frac {(a-3 b) \operatorname {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (c+d x)\right )}{2 (a-b)^2 d}+\frac {b^2 \operatorname {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\tan (c+d x)\right )}{(a-b)^2 d}\\ &=\frac {(a-3 b) x}{2 (a-b)^2}+\frac {b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} (a-b)^2 d}+\frac {\cos (c+d x) \sin (c+d x)}{2 (a-b) d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.19, size = 78, normalized size = 0.94 \[ \frac {4 b^{3/2} \tan ^{-1}\left (\frac {\sqrt {b} \tan (c+d x)}{\sqrt {a}}\right )+\sqrt {a} (2 (a-3 b) (c+d x)+(a-b) \sin (2 (c+d x)))}{4 \sqrt {a} d (a-b)^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.56, size = 290, normalized size = 3.49 \[ \left [\frac {2 \, {\left (a - 3 \, b\right )} d x + 2 \, {\left (a - b\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \sqrt {-\frac {b}{a}} \log \left (\frac {{\left (a^{2} + 6 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} - 2 \, {\left (3 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{2} - 4 \, {\left ({\left (a^{2} + a b\right )} \cos \left (d x + c\right )^{3} - a b \cos \left (d x + c\right )\right )} \sqrt {-\frac {b}{a}} \sin \left (d x + c\right ) + b^{2}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} + 2 \, {\left (a b - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right )}{4 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} d}, \frac {{\left (a - 3 \, b\right )} d x + {\left (a - b\right )} \cos \left (d x + c\right ) \sin \left (d x + c\right ) - b \sqrt {\frac {b}{a}} \arctan \left (\frac {{\left ({\left (a + b\right )} \cos \left (d x + c\right )^{2} - b\right )} \sqrt {\frac {b}{a}}}{2 \, b \cos \left (d x + c\right ) \sin \left (d x + c\right )}\right )}{2 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} d}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 1.52, size = 110, normalized size = 1.33 \[ \frac {\frac {2 \, {\left (\pi \left \lfloor \frac {d x + c}{\pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\relax (b) + \arctan \left (\frac {b \tan \left (d x + c\right )}{\sqrt {a b}}\right )\right )} b^{2}}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \sqrt {a b}} + \frac {{\left (d x + c\right )} {\left (a - 3 \, b\right )}}{a^{2} - 2 \, a b + b^{2}} + \frac {\tan \left (d x + c\right )}{{\left (\tan \left (d x + c\right )^{2} + 1\right )} {\left (a - b\right )}}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.65, size = 137, normalized size = 1.65 \[ \frac {b^{2} \arctan \left (\frac {\tan \left (d x +c \right ) b}{\sqrt {a b}}\right )}{d \left (a -b \right )^{2} \sqrt {a b}}+\frac {\tan \left (d x +c \right ) a}{2 d \left (a -b \right )^{2} \left (1+\tan ^{2}\left (d x +c \right )\right )}-\frac {\tan \left (d x +c \right ) b}{2 d \left (a -b \right )^{2} \left (1+\tan ^{2}\left (d x +c \right )\right )}+\frac {\arctan \left (\tan \left (d x +c \right )\right ) a}{2 d \left (a -b \right )^{2}}-\frac {3 \arctan \left (\tan \left (d x +c \right )\right ) b}{2 d \left (a -b \right )^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.44, size = 95, normalized size = 1.14 \[ \frac {\frac {2 \, b^{2} \arctan \left (\frac {b \tan \left (d x + c\right )}{\sqrt {a b}}\right )}{{\left (a^{2} - 2 \, a b + b^{2}\right )} \sqrt {a b}} + \frac {{\left (d x + c\right )} {\left (a - 3 \, b\right )}}{a^{2} - 2 \, a b + b^{2}} + \frac {\tan \left (d x + c\right )}{{\left (a - b\right )} \tan \left (d x + c\right )^{2} + a - b}}{2 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 13.89, size = 254, normalized size = 3.06 \[ -\frac {6\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (c+d\,x\right )}{\cos \left (c+d\,x\right )}\right )-a^2\,\sin \left (2\,c+2\,d\,x\right )-2\,a^2\,\mathrm {atan}\left (\frac {\sin \left (c+d\,x\right )}{\cos \left (c+d\,x\right )}\right )+a\,b\,\sin \left (2\,c+2\,d\,x\right )+\mathrm {atan}\left (\frac {a^2\,b^3\,\sin \left (c+d\,x\right )\,\sqrt {-a\,b^3}\,9{}\mathrm {i}-a^3\,b^2\,\sin \left (c+d\,x\right )\,\sqrt {-a\,b^3}\,6{}\mathrm {i}-a\,b^4\,\sin \left (c+d\,x\right )\,\sqrt {-a\,b^3}\,4{}\mathrm {i}+a^4\,b\,\sin \left (c+d\,x\right )\,\sqrt {-a\,b^3}\,1{}\mathrm {i}}{-\cos \left (c+d\,x\right )\,a^5\,b^2+6\,\cos \left (c+d\,x\right )\,a^4\,b^3-9\,\cos \left (c+d\,x\right )\,a^3\,b^4+4\,\cos \left (c+d\,x\right )\,a^2\,b^5}\right )\,\sqrt {-a\,b^3}\,4{}\mathrm {i}}{4\,d\,a^3-8\,d\,a^2\,b+4\,d\,a\,b^2} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________